package me.sdevil507.org.mapper;

import me.sdevil507.org.dto.TempExpertDto;
import me.sdevil507.org.po.TempExpertPo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 组织下用户[OrgUserMapper]
 *
 * @author sdevil507
 * created on 2020-06-23 20:03:45
 */
@Component
@Mapper(componentModel = "spring")
public interface TempExpertMapper {

    /**
     * po => dto
     *
     * @param po 实体类
     * @return dto传输类
     */
    TempExpertDto po2dto(TempExpertPo po);

    /**
     * pos => dtos
     *
     * @param pos 实体类集合
     * @return dtos传输类集合
     */
    List<TempExpertDto> pos2dtos(List<TempExpertPo> pos);


    /**
     * dto => po
     *
     * @param dto 传输类
     * @return po实体类
     */
    @Mapping(target = "deleted", defaultValue = "false")
    @Mapping(target = "locked", defaultValue = "false")
    TempExpertPo dto2po(TempExpertDto dto);

    /**
     * dtos => pos
     *
     * @param dtos 传输类集合
     * @return pos实体类集合
     */
    List<TempExpertPo> dtos2pos(List<TempExpertDto> dtos);

}